﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:linq="http://schemas.microsoft.com/linqtosql/mapping/2007">
  <xsl:param name="prefix"/>
  <xsl:output method="xml" />

  <!-- Set prefix for /Database/Table/@Name attribute -->
  <xsl:template match="/linq:Database/linq:Table/@Name">
    <xsl:attribute name="Name">
      <xsl:value-of select="$prefix"/>
      <xsl:value-of select="."/>
    </xsl:attribute>
  </xsl:template>

  <!-- Copy the rest -->
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
